package com.jia.blog.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author jiajia
 * @since 2020-12-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("m_blog")
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 博客id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 博客标题
     */
    @NotBlank(message = "博客标题不能为空")
    private String title;

    /**
     * 博客描述
     */
    @NotBlank(message = "博客描述不能为空")
    private String description;

    /**
     * 博客内容
     */
    @NotBlank(message = "博客内容不能为空")
    private String content;

    /**
     * 博客状态：1显示0隐藏
     */
    private Boolean status;

    /**
     * 博客排序
     */
    private Integer sort;

    /**
     * 是否推荐
     */
    private Integer recommend;
    /**
     * 分类id
     */
    private Long cateId;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private String username;

    @TableField(exist = false)
    private String userAvatar;


}
